//部门信息连接
const postReplies = require('../mongo/postReplies')
var connect = {
	// 
	find: function (data,callback){
		postReplies.find(data,function(err,datas){
			
			callback(datas)
		})
	},
	//
	add: function(data,callback){
		new postReplies(data).save(function(err,datas){
			if(!err) callback(1)
		})
	},
	// 修改
	update: function (factor, data, callback) {
		// console.log(data)
		postReplies.updateOne(factor, data, function (err, res) {
			if(!err) callback(1)
		})
	},
	// 删除
	delete: function(data,callback){
		postReplies.deleteMany(data,function(err,data){
			if(!err){
				return callback(1)
			}else{
				return callback(0)
			}
		})
	}
}
module.exports = connect
